﻿using Model.BusinessModel.OutPut;
using Model.BusinessModel.OutPut.sys;
using Model.DomainModel.Sys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.IRepository.Sys
{
    /// <summary>
    /// 部门仓储接口
    /// </summary>
    public interface ISysDepartmentRepository : IRepository<SysDepartment>
    {
        /// <summary>
        /// 根据名称获取部门信息
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <param name="name">部门名称</param>
        /// <returns></returns>
        SysDepartment? GetSysDepartmentByName(string corporationKey, string name);

        /// <summary>
        /// 根据公司获取数据
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <returns></returns>
        List<SysDepartment> GetDepartmentByCorporationKey(string corporationKey);

        /// <summary>
        /// 获取公司下的部门
        /// </summary>
        /// <returns></returns>
        List<TreeOutPut> GetCorporationDepartmentList(string corporationKey);

        /// <summary>
        /// 获取所有公司及部门--登录公司为星辰公司，可以获取全部，否则只获取登录公司数据
        /// </summary>
        /// <returns></returns>
        List<TreeOutPut> GetAllCorporationDepartmentList(string corporationKey);

        /// <summary>
        /// 根据id删除部门
        /// </summary>
        /// <param name="ids">部门id集合</param>
        void DeleteDepartmentById(List<string> ids);

        /// <summary>
        /// 根据id获取部门下的人员
        /// </summary>
        /// <param name="ids">部门Id</param>
        /// <param name="corporationKey">公司key</param>
        /// <returns></returns>
        List<SysDepartmentOutPut> GetDepartmentById(List<string>? ids, string? corporationKey,string authWhere);
    }
}
